#include <iostream>
#include <string>
using namespace std;
class Cretaure
{
    class State
    {
    public:
        virtual string response() = 0;
        virtual ~State() = default;
    };

    class Frog : public State
    {
    public:
        string response()
        {
            return "Ribbet!";
        };
    };

    class Prince : public State
    {
    public:
        string response()
        {
            return "Darling!";
        };
    };
    State *state;

public:
    Cretaure() : state(new Frog())
    {
    }
    void greet()
    {
        cout << state->response() << endl;
    }
    void kiss()
    {
        delete state;
        state = new Prince();
    }
};

int main()
{
    Cretaure creature;
    creature.greet();
    creature.kiss();
    creature.greet();
    return 0;
}
